USE [master]
GO

/****** Object:  Database [VideoChat]    Script Date: 11/06/2012 19:45:27 ******/
CREATE DATABASE [VideoChat] ON  PRIMARY 
( NAME = N'VideoChat', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\VideoChat.mdf' , SIZE = 7168KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'VideoChat_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\VideoChat_log.ldf' , SIZE = 2048KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO

ALTER DATABASE [VideoChat] SET COMPATIBILITY_LEVEL = 100
GO

IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [VideoChat].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO

ALTER DATABASE [VideoChat] SET ANSI_NULL_DEFAULT OFF 
GO

ALTER DATABASE [VideoChat] SET ANSI_NULLS OFF 
GO

ALTER DATABASE [VideoChat] SET ANSI_PADDING OFF 
GO

ALTER DATABASE [VideoChat] SET ANSI_WARNINGS OFF 
GO

ALTER DATABASE [VideoChat] SET ARITHABORT OFF 
GO

ALTER DATABASE [VideoChat] SET AUTO_CLOSE OFF 
GO

ALTER DATABASE [VideoChat] SET AUTO_CREATE_STATISTICS ON 
GO

ALTER DATABASE [VideoChat] SET AUTO_SHRINK OFF 
GO

ALTER DATABASE [VideoChat] SET AUTO_UPDATE_STATISTICS ON 
GO

ALTER DATABASE [VideoChat] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO

ALTER DATABASE [VideoChat] SET CURSOR_DEFAULT  GLOBAL 
GO

ALTER DATABASE [VideoChat] SET CONCAT_NULL_YIELDS_NULL OFF 
GO

ALTER DATABASE [VideoChat] SET NUMERIC_ROUNDABORT OFF 
GO

ALTER DATABASE [VideoChat] SET QUOTED_IDENTIFIER OFF 
GO

ALTER DATABASE [VideoChat] SET RECURSIVE_TRIGGERS OFF 
GO

ALTER DATABASE [VideoChat] SET  DISABLE_BROKER 
GO

ALTER DATABASE [VideoChat] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO

ALTER DATABASE [VideoChat] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO

ALTER DATABASE [VideoChat] SET TRUSTWORTHY OFF 
GO

ALTER DATABASE [VideoChat] SET ALLOW_SNAPSHOT_ISOLATION OFF 
GO

ALTER DATABASE [VideoChat] SET PARAMETERIZATION SIMPLE 
GO

ALTER DATABASE [VideoChat] SET READ_COMMITTED_SNAPSHOT OFF 
GO

ALTER DATABASE [VideoChat] SET HONOR_BROKER_PRIORITY OFF 
GO

ALTER DATABASE [VideoChat] SET  READ_WRITE 
GO

ALTER DATABASE [VideoChat] SET RECOVERY FULL 
GO

ALTER DATABASE [VideoChat] SET  MULTI_USER 
GO

ALTER DATABASE [VideoChat] SET PAGE_VERIFY CHECKSUM  
GO

ALTER DATABASE [VideoChat] SET DB_CHAINING OFF 
GO


USE [VideoChat]
GO

/****** Object:  Table [dbo].[Account]    Script Date: 11/06/2012 19:45:48 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Account](
	[UserKey] [varchar](36) NULL,
	[UserName] [varchar](255) NULL,
	[Deleted] [bit] NULL,
	[Created] [datetime] NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[Account] ADD  CONSTRAINT [DF_Account_Created]  DEFAULT (getdate()) FOR [Created]
GO


USE [VideoChat]
GO

/****** Object:  Table [dbo].[Chat]    Script Date: 11/06/2012 19:45:59 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Chat](
	[RoomKey] [varchar](36) NULL,
	[SenderName] [varchar](255) NULL,
	[Content] [varchar](max) NULL,
	[SendDate] [datetime] NULL,
	[SenderKey] [varchar](36) NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO


USE [VideoChat]
GO

/****** Object:  Table [dbo].[RoomInfo]    Script Date: 11/06/2012 19:46:08 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[RoomInfo](
	[RoomKey] [varchar](36) NULL,
	[MyPublicKey] [varchar](36) NULL,
	[MyKey] [varchar](36) NULL,
	[MyName] [nvarchar](255) NULL,
	[CalleePublicKey] [varchar](36) NULL,
	[CalleeKey] [varchar](36) NULL,
	[CalleeName] [nvarchar](255) NULL,
	[StartDate] [datetime] NULL,
	[EndDate] [datetime] NULL,
	[MyVideoState] [int] NULL,
	[CalleeVideoState] [int] NULL,
	[MyCam] [bit] NULL,
	[MyCamOn] [bit] NULL,
	[MyMic] [bit] NULL,
	[MyMicOn] [bit] NULL,
	[CalleeCam] [bit] NULL,
	[CalleeCamOn] [bit] NULL,
	[CalleeMic] [bit] NULL,
	[CalleeMicOn] [bit] NULL
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

